import java.util.ArrayList;
import java.util.*;
public class Test {
    public synchronized void fun1(){
        fun2();
    }
    public void fun2(){
        fun3();
    }
    public void fun3(){
        fun4();
    }
    public synchronized void fun4(){
        //一些代码逻辑
    }
    public static void main(String[] args){
        Test test = new Test();
        Thread t1 = new Thread(new Runnable() {
            @Override
            public void run() {
                test.fun();
            }
        });
    }
}
